<a href="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => 'users', 'action' => 'view_profile'));?>"><?=$this->user->GetUserName();?></a>
|
<?=$this->user->groupName;?> |
<a href="#" class="exit" onclick="logoutForm.submit(); return false;"><span>Выйти</span></a>
<form name="logoutForm" method="post" action=""><input type="hidden" name="logout" value="1"></form>	
<script type="text/javascript">
var login_checker;

$(document).ready(
  function()
  {
	login_checker = setInterval("check_login()", 60000);
  }
);

function check_login()
{
	$.ajax( {url: "<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => 'users', 'action' => 'check_login'));?>",
			dataType: 'json',
			success:function (data){
						if (data.status == 0) return true;

						$('#statusBar').html(data.data.result);
						showMessage(data.message, true, true);

						clearTimeout(login_checker);

						return false;
					}
	} );
}

</script>